using System;
using System.Collections.Generic;
using MediatR;

namespace Agriculture.Api.Read.Application.Command
{
    /// <summary>
    /// 处方流转订单详情查询命令
    /// </summary>
    public class PrescriptionOrderDetailQuery : IRequest<PrescriptionOrderDetailResult>
    {
        /// <summary>
        /// 订单编号
        /// </summary>
        public string OrderNo { get; set; }
    }

    /// <summary>
    /// 处方流转订单详情结果
    /// </summary>
    public class PrescriptionOrderDetailResult
    {
        /// <summary>
        /// 患者信息
        /// </summary>
        public PatientInfo Patient { get; set; } = new PatientInfo();

        /// <summary>
        /// 处方信息
        /// </summary>
        public PrescriptionInfo Prescription { get; set; } = new PrescriptionInfo();

        /// <summary>
        /// 订单信息
        /// </summary>
        public OrderInfo Order { get; set; } = new OrderInfo();
    }

    /// <summary>
    /// 患者信息
    /// </summary>
    public class PatientInfo
    {
        /// <summary>
        /// 患者姓名
        /// </summary>
        public string Name { get; set; }

        /// <summary>
        /// 性别
        /// </summary>
        public string Gender { get; set; }

        /// <summary>
        /// 年龄
        /// </summary>
        public int Age { get; set; }

        /// <summary>
        /// 手机号
        /// </summary>
        public string Phone { get; set; }

        /// <summary>
        /// 所患疾病
        /// </summary>
        public string Disease { get; set; }

        /// <summary>
        /// 肝功能
        /// </summary>
        public string LiverFunction { get; set; }

        /// <summary>
        /// 肾功能
        /// </summary>
        public string KidneyFunction { get; set; }

        /// <summary>
        /// 过敏史
        /// </summary>
        public string AllergyHistory { get; set; }

        /// <summary>
        /// 生育计划或状态
        /// </summary>
        public string FertilityStatus { get; set; }

        /// <summary>
        /// 病情描述
        /// </summary>
        public string DiseaseDescription { get; set; }
    }

    /// <summary>
    /// 处方信息
    /// </summary>
    public class PrescriptionInfo
    {
        /// <summary>
        /// 处方编号
        /// </summary>
        public string No { get; set; }

        /// <summary>
        /// 开单时间
        /// </summary>
        public DateTime CreateTime { get; set; }

        /// <summary>
        /// 处方单状态
        /// </summary>
        public string Status { get; set; }

        /// <summary>
        /// 医生
        /// </summary>
        public string Doctor { get; set; }

        /// <summary>
        /// 科室
        /// </summary>
        public string Department { get; set; }

        /// <summary>
        /// 初步诊断
        /// </summary>
        public string Diagnosis { get; set; }

        /// <summary>
        /// 处理意见
        /// </summary>
        public string Treatment { get; set; }

        /// <summary>
        /// 药品列表
        /// </summary>
        public List<PrescriptionMedicineInfo> Medicines { get; set; } = new List<PrescriptionMedicineInfo>();
    }

    /// <summary>
    /// 处方药品信息
    /// </summary>
    public class PrescriptionMedicineInfo
    {
        /// <summary>
        /// 药品名称
        /// </summary>
        public string Name { get; set; }

        /// <summary>
        /// 药品图片URL
        /// </summary>
        public string ImageUrl { get; set; }

        /// <summary>
        /// 数量
        /// </summary>
        public int Quantity { get; set; }

        /// <summary>
        /// 规格
        /// </summary>
        public string Specification { get; set; }

        /// <summary>
        /// 单价
        /// </summary>
        public decimal Price { get; set; }

        /// <summary>
        /// 用药情况
        /// </summary>
        public string Usage { get; set; }
    }

    /// <summary>
    /// 订单信息
    /// </summary>
    public class OrderInfo
    {
        /// <summary>
        /// 订单编号
        /// </summary>
        public string OrderNo { get; set; }

        /// <summary>
        /// 订单状态
        /// </summary>
        public string Status { get; set; }

        /// <summary>
        /// 购药方式
        /// </summary>
        public string PurchaseMethod { get; set; }

        /// <summary>
        /// 发药状态
        /// </summary>
        public string DispenseStatus { get; set; }

        /// <summary>
        /// 应付金额
        /// </summary>
        public decimal PayableAmount { get; set; }

        /// <summary>
        /// 优惠券
        /// </summary>
        public decimal CouponAmount { get; set; }

        /// <summary>
        /// 实际支付
        /// </summary>
        public decimal ActualPayment { get; set; }

        /// <summary>
        /// 创建时间
        /// </summary>
        public DateTime CreateTime { get; set; }

        /// <summary>
        /// 支付方式
        /// </summary>
        public string PaymentMethod { get; set; }

        /// <summary>
        /// 支付时间
        /// </summary>
        public DateTime? PaymentTime { get; set; }
    }
} 